package com.ocean.controller.news;

import com.ocean.entity.news.News;
import com.ocean.service.news.NewsService;
import com.ocean.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/news")
public class NewsController {

    @Autowired
    private NewsService service;

    @PostMapping("save.do")
    public R save(@RequestBody News news){
        return service.save(news);
    }
    @PostMapping("update.do")
    public R update(@RequestBody News news){
        return service.update(news);
    }
    @GetMapping("del.do")
    public R delete(int id){
        return service.delete(id);
    }
    @GetMapping("page.do")
    public R page(int page, int size){
        return service.queryPage(page, size);
    }

}
